package com.tszs.Controller;
import java.io.PrintWriter;

 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
 
@RequestMapping("/wechat")
@Controller
public class WechatController {
	private static Logger logger = Logger.getLogger(WechatController.class);
	 
	private static String WECHAT_TOKEN = "wx_oms";
 
	@RequestMapping(value = "/wx.do")
	public void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String signature = request.getParameter("signature");/// 微信加密签名
		String timestamp = request.getParameter("timestamp");/// 时间戳
		String nonce = request.getParameter("nonce"); /// 随机数
		String echostr = request.getParameter("echostr"); // 随机字符串
		PrintWriter out = response.getWriter();
 
		//if (SignUtil.checkSignature(signature, timestamp, nonce)) {
			out.print(echostr);
//		}s
		out.close();
//		out = null;
 
	}
}
